﻿using System.Linq;

namespace cludg.Services.Content
{
	using Domain.Content.Stories;
	using Domain.Users;

	/// <summary>
	/// Offer service interface
	/// </summary>
	public interface IOfferService
	{
		/// <summary>
		/// Get all offers
		/// </summary>
		IQueryable<Offer> All { get; }

		/// <summary>
		/// Get offer by Id
		/// </summary>
		/// <param name="offerId">Offer Id</param>
		/// <returns>Offer with specified id</returns>
		Offer ById(string offerId);

		/// <summary>
		/// Create new offer
		/// </summary>
		/// <param name="subject">Offer subject</param>
		/// <param name="author">Story author</param>
		/// <param name="comment">Comment to offer</param>
		/// <param name="title">Offer title</param>
		/// <param name="anonymouseAutorName">Anonumouse Author name</param>
		/// <returns>Created offer</returns>
		Offer NewOffer(StorySubject subject, User author, string comment, string title, string anonymouseAutorName);

		Story Approve(Offer offer, User author, string title, string body, string anonymouseAutorName, string tags);

		void Decline(Offer offer, User author);
		
		/// <summary>
		/// Delete offer by id
		/// </summary>
		/// <param name="offerId">Offer id</param>
		void Delete(string offerId);
	}
}
